#include <iostream>
#include <vector>

using namespace std;

// 2090. 半径为 k 的子数组平均值
// https://leetcode.cn/problems/k-radius-subarray-averages/description/

class Solution
{
public:
    vector<int> getAverages(vector<int> &nums, int k)
    {
        int n = nums.size();
        vector<int> ans(n, -1);
        int left = 0;
        int sum = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            sum += nums[i];
            if (i - left + 1 < (2 * k + 1))
            {
                continue;
            }
            if (k != 0)
            {
                ans[i - k] = sum / (2*k + 1);
            }
            else
            {
                ans[i - k] = sum;
            }

            sum -= nums[left++];
        }
        return ans;
    }
};

int main()
{
    return 0;
}